home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 1 / CU Amiga Magazine CD-ROM Special Edition (1995)(EMAP Images)(GB)[Issue 1995-11].iso / Aminet / biz / demo / StylusDemo.lha / Stylus_Demo / REXX / Cartesian_Coords.pvrx next >
Text File  |  1994-08-10  |  1KB  |  47 lines

  1. /***************************************************************************
  2. *                                                                          *
  3. *  $VER: Cartesian_Coords.pvrx 1.0 (10.Aug.94)                             *
  4. *   Copyright © 1994 by Stylus, Inc.                                       *
  5. *   Author:  Jeff Blume                                                    *
  6. *                                                                          *
  7. *   Set the page to a Cartesian coordinate system with the origin in the   *
  8. *     center of the page.                                                  *
  9. *                                                                          *
  10. *                                                                          *
  11. ***************************************************************************/
  12.  
  13. /*
  14. call open STDOUT,"RAD:RxOut.txt",W
  15. call open STDERR,"RAD:RxErr.txt",W
  16. trace R
  17. */
  18.  
  19. 'Lock'
  20. if rc ~= 0 then exit
  21.  
  22. 'GetPageSize' Pdims
  23.  
  24. CPX = Pdims.X2 + Pdims.X1
  25. if CPX ~= 0 then do
  26.     CPX = CPX / 2
  27.     Pdims.X1 = -CPX
  28.     Pdims.X2 = CPX    
  29. end
  30.  
  31. CPY = Pdims.Y2 + Pdims.Y1
  32. if CPY ~= 0 then do
  33.     CPY = CPY / 2
  34.     Pdims.Y1 = CPY
  35.     Pdims.Y2 = -CPY
  36. end
  37.  
  38. if CPX ~= 0 & CPY ~= 0 then 'SetPageSize' Pdims
  39. else 'GetBool "Origin already centered." "OK" "OK"'
  40. /* This doesn't cover case where origin is centered,
  41.    but Y axis is descending. */
  42.  
  43. 'UnLock'
  44.  
  45.  
  46. EXIT
  47.